package TamirsGui;

public class GuiMessage {
	
	public enum MessageType{ack,content,popup,refresh};
	public enum MessageSubType{subForum,subForumAdded,threadMsg,postMsg,moderatorList,candidateList,registerAck, loginAck, moderatorRemoved,
                                                                                        msgEdited, subForumDeleted, msgDeleted,moderatorAdded,addedMsgAck,pathNotFound, numOfMessages, usersList, adminList, changeAdminAck, numOfConnectionAck};
	public enum MessageAuthorization{admin,moderator,owner,member,guest};
	
	private String body;
	private String title;
	private String messageId;
	private MessageType type;
	private MessageSubType subType;
	private MessageAuthorization authorization;
	public GuiMessage(String body, String title, MessageType type,
			MessageSubType subType, MessageAuthorization authorization) {
		this.setBody(body);
		this.setTitle(title);
		this.setType(type);
		this.setSubType(subType);
		this.setAuthorization(authorization);
		this.setMessageId("");
	}
	public GuiMessage(String body, String title, MessageType type,
			MessageSubType subType, MessageAuthorization authorization,String messageID) {
		this.setBody(body);
		this.setTitle(title);
		this.setType(type);
		this.setSubType(subType);
		this.setAuthorization(authorization);
		this.setMessageId(messageID);
	}
	
	/**
	 * @return the body
	 */
	public String getBody() {
		return body;
	}
	/**
	 * @param body the body to set
	 */
	public void setBody(String body) {
		this.body = body;
	}
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * @return the type
	 */
	public MessageType getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(MessageType type) {
		this.type = type;
	}
	/**
	 * @return the subType
	 */
	public MessageSubType getSubType() {
		return subType;
	}
	/**
	 * @param subType the subType to set
	 */
	public void setSubType(MessageSubType subType) {
		this.subType = subType;
	}
	/**
	 * @return the authorization
	 */
	public MessageAuthorization getAuthorization() {
		return authorization;
	}
	/**
	 * @param authorization the authorization to set
	 */
	public void setAuthorization(MessageAuthorization authorization) {
		this.authorization = authorization;
	}
	
	public String toString(){
		return this.title;
	}
	
	public boolean equals(GuiMessage other){
		boolean ans = (this.title.equals(other.getTitle())&&this.body.equals(other.getBody())&&
						this.authorization.equals(other.getAuthorization()) && 
						this.subType.equals(other.getSubType()) && this.type.equals(other.getType()));
		return ans;
		
	}
	/**
	 * @return the messageId
	 */
	public String getMessageId() {
		return messageId;
	}
	/**
	 * @param messageId the messageId to set
	 */
	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}
	
	

	

}
